<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        // number,string,boolean之间的相互转换
        /* 1，string，boolean-->number
            Number() --强制转换
         */
        var a ="12";
        var b=Number(a);
        var str="12px"
        console.log(typeof(b));
        console.log(b);
        console.log(a);
        console.log(Number(str));//NaN 不是一个数字
    </script>
</body>
</html>